var beiMiCommon = require("BeiMiCommon");

cc.Class({
  extends: beiMiCommon,

  properties: {
    daikaiItemPrefab: {
      default: null,
      type: cc.Prefab
    },

    scoreScrollview: {
      default: null,
      type: cc.ScrollView
    },

    empty:{
      default: null,
      type:cc.Node
    }
  },

  onLoad: function() {
      
  },

  init(list) {
    let self = this;
    if (!list||list.length<1) {
      this.empty.active = true;
    }else {
      for (let i = 0; i < list.length; i++) {
        let item = cc.instantiate(self.daikaiItemPrefab);
        self.scoreScrollview.content.addChild(item);
        item.setPosition(0, -item.height * (1.5 + i) - 5 * i+50);
        item.getComponent('DaikaiItem').init(list[i], i);
     }
    }

  },
});
